<template>
  <div class="page-container">
    <PanelTab @change="handleChange" @export="handleExport" />
    <div class="page-content">
      <Panel1 :data="dataOverview" />
      <Panel2 :data="employeeWork" />
    </div>

    <!--  导出 -->
    <el-dialog title="导出" :visible.sync="showDialogExport" width="30%">
      <DialogExport v-if="showDialogExport" :time="time" @close="showDialogExport = false" />
    </el-dialog>
  </div>
</template>

<script>
import PanelTab from '@/components/panel/PanelTab.vue'
import Panel1 from './components/Panel1.vue'
import Panel2 from './components/Panel2.vue'
import DialogExport from './components/DialogExport.vue'
import { apiPmOverview } from '@/api/biddingNotice'

export default {
  name: 'CompetitorStatistics',
  components: { PanelTab, Panel1, Panel2, DialogExport },
  data() {
    return {
      time: {},
      showDialogExport: false,
      dataOverview: [],
      employeeWork: [],
    }
  },
  mounted() {},
  destroyed() {},
  methods: {
    // 时间变动
    handleChange(time) {
      this.time = time
      this.getData()
    },
    getData() {
      apiPmOverview({ ...this.time, label: '拍卖' }).then((res) => {
        const { data_overview, employee_work } = res.info
        this.dataOverview = data_overview
        this.employeeWork = employee_work
      })
    },
    handleExport() {
      this.showDialogExport = true
    },
  },
}
</script>

<style scoped lang="scss"></style>
